package alo.p6;
//二叉树的基本结构
public class BinaryTreeNode {
    //数据和左右子树的定义
    private int data;
    private BinaryTreeNode left;
    private BinaryTreeNode right;

    public BinaryTreeNode() {
    }

    public BinaryTreeNode(int data) {
        this.data = data;
        this.setLeft(null);
        this.setRight(null);
    }

    //数据的get和set方法
    public int getData() {
        return data;
    }
    public void setData(int data) {
        this.data = data;
    }
    //左子树的get和set方法
    public BinaryTreeNode getLeft() {
        return left;
    }
    public void setLeft(BinaryTreeNode left) {
        this.left = left;
    }

    //右子树的get和set方法
    public BinaryTreeNode getRight() {
        return right;
    }
    public void setRight(BinaryTreeNode right) {
        this.right = right;
    }
}
